The present invention relates to an apparatus for subjecting a character to three-dimensional computer graphics processing by relating skeleton that describes a framework to polygon data that describes an outer surface, and in particular, to a three-dimensional skeleton data error absorbing apparatus for absorbing an error based on calculation of skeleton data.
Due to the recent enhanced performance of computer systems and development of a multimedia processing technique, an environment allowing even a personal computer or the like to process sophisticated three-dimensional computer graphics (hereinafter, abbreviated as a xe2x80x9cCGxe2x80x9d) is being established, and a graphic accelerator board and the like dedicated to processing of a three-dimensional CG are being provided.
There are various types of data formats of a three-dimensional CG. In a game involving the movement of a character such as an artificial creature and an object, generally, data on an object is held mainly in a polygon format, and regarding a rendering process, a texture is attached to a generated polygon mesh, whereby high-speed rendering processing is conducted.
The polygon is obtained by relating positional information of polygon vertexes to texture information that is a graphic pattern, and forms an outer surface of a three-dimensional character such as an artificial creature. The polygon is data for forming a mesh-shaped wire-frame model by disposing polygon vertexes on the outer surface of a three-dimensional object model designed by an animator so that changes in an outside shape are understood, and connecting each polygon vertex, and is related to texture information describing the pattern of an outer surface.
As described above, in the case where data is held in a polygon format, as the number of polygons that can be assigned to an object is larger, CG processing of higher quality will be achieved. In a recent entertainment application, there is a demand for a high quality rendering. It is not rare that more than 2,000 polygons are assigned to a three-dimensional character in order to satisfy user""s needs. It is a demanding task to describe the movement/deformation on a polygon vertex basis, so as to provide a three-dimensional object described by a large number of polygons with movement/deformation information in accordance with each scene. Therefore, an idea of skeleton is introduced. If the movement of a three-dimensional character such as an artificial creature is expressed by skeleton that is to be a framework thereof, and polygon data that is to be an outer surface is related to the skeleton, it becomes easy to conduct polygon deformation processing. This is because, in general, an artificial creature also has joints conceptually, and its skeleton is mostly operated with respect to the joints. The movement of an artificial creature on a scene basis is described as changes in skeleton. Since each skeleton is related to polygon vertexes forming the outside shape, the movement of each polygon vertex can be described and calculated based on the movement of the skeleton.
Skeleton describing the movement of a three-dimensional character has the following features.
Firstly, there is a parenthood relationship in linking between skeletons. For example, in the case of an arm of an artificial creature, parenthood relationships are defined in the order from a shoulder that is a parent, a brachium, a forearm, and a hand. When the brachium is moved, the forearm and the hand are moved in accordance with the movement of the brachium, and the hand is moved in accordance with the movement of the forearm. More specifically, when the movement of a parent object is described, the movement is automatically reflected onto the description of the movement of a child object.
Secondly, matrix calculation is used for processing the movement of skeleton. A complicated multi-dimensional vector calculation is required for describing the movement in a three-dimensional virtual space, which is processed by matrix calculation. The parenthood relationship described as the above-mentioned first feature is also subjected to calculation by matrix multiplication. In the case where skeleton has a plurality of linked parenthood relationships as in the above example of the arm, matrix multiplications are conducted a plurality of times corresponding to the number of parenthood relationships.
Thirdly, the length of a skeleton has a value specific to each skeleton. More specifically, there are long skeletons and short skeletons. In terms of principle, there may be a skeleton as a fulcrum for rotation, having no length. In the case where a long skeleton 1002 is rotated as shown in FIG. 10(a), even when an angle is slightly changed, the movement of its end portion may be expressed in a large amount. In contrast, in the case where the movement amount at the end portion of a skeleton because of an error is the same between a long skeleton and a short skeleton, a movement angle becomes smaller in the long skeleton, so that a visual deformation degree is decreased therein.
Fourthly, due to the features of a three-dimensional object and setting of a model by an animator, there is a so-called xe2x80x9cdepth of a hierarchyxe2x80x9d in skeleton linking. The depth of a hierarchy expresses the number of skeletons to be linked for forming a unified object. In an object having a deep skeleton hierarchy as shown in FIG. 10(b), the number of skeletons for forming the object is generally large. For example, in a tail of an artificial dinosaur that moves flexibly, a nose of an elephant, and the like, models having a relatively large number of linked skeletons are adopted. Therefore, such models are considered to have a deep skeleton hierarchy.
Fifthly, a skeleton is related to a polygon vertex forming an outer surface, and has a numerical value such as a weight representing a degree of an influence of the movement of each skeleton on the movement of each polygon vertex. For example, in the case where a weight of a polygon vertex with respect to a skeleton is xe2x80x9c100xe2x80x9d, the polygon vertex moves 100% in accordance with the movement of the skeleton. In the case where a weight is xe2x80x9c0xe2x80x9d, even when the skeleton is changed, the polygon vertex will neither be influenced nor changed.
As described in the above-mentioned prior art, by using skeleton data, the movement of a three-dimensional character is described on a skeleton basis, and an apparatus user such as an animator can easily describe an animation scene.
However, according to graphics processing of a three-dimensional character using skeleton, the following error occurs based on skeleton calculation. When a rendering is actually conducted as shown in FIG. 10(c), although a dotted line represents the position of skeletons to be displayed, the skeletons are in some cases displayed, being shifted to a position represented by a solid line. In this manner, the position of a rendered object is shifted, and the object unnaturally wobbles and does not move smoothly.
The first problem of a skeleton calculation error is that an error occurring at a time of calculation of a parent skeleton is transferred to child skeleton calculation and accumulated/amplified. In particular, in the case where a hierarchy of skeleton forming an object is deep, an error with respect to a child skeleton at an end is increased in a transfer/accumulation amount. Skeleton calculation is a product of matrix calculation, so that an error is increased due to multiplication.
The second problem of a skeleton calculation error is based on the difference in a computer resource to be a platform. More specifically, when an animator creates a three-dimensional character, the three-dimensional character is created with a high detail and precision. Therefore, a workstation with a high processing ability and the like are generally used, and calculation is conducted by the double-precision operation xe2x80x9cDOUBLEWORDxe2x80x9d. On the other hand, for actually rendering the three-dimensional character in a game by a user, an inexpensive platform with a processing ability which is not so high as that in the workstation is mostly used, and calculation is in most cases conducted in the floating-point operation of single-precision xe2x80x9cFLOATxe2x80x9d. In this case, even if matrix multiplication with high precision is conducted, numerical values may be rounded off, and the rounded-off error is accumulated/amplified on a matrix calculation basis.
The third problem of a skeleton calculation error is based on the length of a skeleton. A skeleton has a length, and the rotation of the skeleton is obtained by a radian angle and a movement amount of an end portion. Even in the case where an error occurring in calculation is a small value representing a small shift that cannot be visually recognized on a screen, when the error movement amount of an end portion is the same between a short skeleton and a long skeleton, the rotation angle becomes larger in the short skeleton than in the long skeleton, and an error at an end becomes larger in the long skeleton than in the short skeleton.
The fourth problem of a skeleton calculation error is as follows: when it is desired to prevent a positional shift and shaking caused by an error with respect to an object having particularly high eye-catching property, among object portions of a three-dimensional character, the occurrence and degree of a skeleton calculation error are determined by other factors, irrespective of the degree of an eye-catching property of skeleton; therefore, an error may become conspicuous to a user.
The three-dimensional skeleton calculation error absorbing apparatus of the present invention overcomes the above-mentioned problems, and its object is to absorb and cancel an error occurring in skeleton calculation. A first object is to absorb and cancel an error transferred/accumulated due to the depth of skeleton by matrix multiplication between a parent skeleton and a child skeleton so that an error will not be excessively accumulated with respect to the movement of the child skeleton. A second object is to absorb and cancel an error transferred/accumulated due to the length of skeleton at an end portion of the skeleton. A third object is to absorb and cancel a rounded-off error which is caused by the difference in calculation precision between the platform at a time of development and creation of a three-dimensional character and the platform in end use by a user. Fourthly, an error of a particular skeleton such as a skeleton of an object portion with a high eye-catching property is preferentially absorbed and cancelled. The object of the three-dimensional skeleton calculation error absorbing apparatus of the present invention is to absorb and cancel an error occurring in skeleton calculation processing, thereby preventing an unnatural positional shift and shaking in a display image of a three-dimensional character so as to obtain a natural and smooth display.
In order to achieve the above-mentioned object, the three-dimensional skeleton calculation error absorbing apparatus of the present invention includes: an input part for inputting skeleton data; a fixed skeleton portion specifying part for specifying a skeleton portion whose display position is desired to be fixed; an error absorbing skeleton specifying part for determining an error absorbing skeleton that absorbs an error based on skeleton calculation among a skeleton group having a linked relationship up to the fixed skeleton portion; a skeleton matrix calculating part for conducting matrix calculation in accordance with a linked relationship of the skeleton; a fixed position storing part for storing a fixed position that is to be a matrix calculation result of the fixed skeleton portion; and an error absorption calculating part for obtaining a skeleton matrix of the error absorbing skeleton in such a manner that, in skeleton matrix calculation for calculating the fixed position in a subsequent frame, a matrix calculation result of the fixed skeleton portion matches the fixed position.
Because of the above-mentioned configuration, a skeleton portion to be fixed, its fixed position, and an error absorbing skeleton that absorbs an error can be specified, and a determinant of the error absorbing skeleton can be adjusted so that a skeleton matrix calculation result of the fixed skeleton portion becomes a coordinate of the fixed position. The fixed skeleton portion is displayed at the coordinate of the fixed position, and a rendered image does not wobble or shift between frames.
Next, it is preferable that, assuming that M1 represents a matrix calculation result obtained by calculating the fixed position, in skeleton matrix calculation for calculating the fixed position in a subsequent frame, M2parent represents a matrix calculation result of a skeleton at a level higher than that of the error absorbing skeleton among skeletons other than the error absorbing skeleton, M2child represents a matrix calculation result of a skeleton at a level lower than that of the error absorbing skeleton, and M3 represents a skeleton matrix of the error absorbing skeleton, the error absorption calculating part obtains the error absorbing skeleton matrix by using an equation M3=M2parentxe2x88x921xc3x97M1xc3x97M2childxe2x88x921.
Because of the above-mentioned configuration, deformation and adjustment of a determinant of an error absorbing skeleton can be correctly obtained by inverse matrix calculation, and a fixed skeleton portion can be displayed at a coordinate of a fixed position.
Next, it is preferable that the error absorbing skeleton specifying part includes a skeleton length detecting part, and selects a longest skeleton among the skeleton group having a linked relationship as the error absorbing skeleton.
Because of the above-mentioned configuration, a skeleton with the longest skeleton length whose movement for absorbing an error is expected to be inconspicuous can be selected as an error absorbing skeleton.
Next, it is preferable that the error absorbing skeleton specifying part includes a skeleton hierarchy level detecting part, and selects a skeleton at a highest hierarchy level among the skeleton group having a linked relationship as the error absorbing skeleton.
Because of the above-mentioned configuration, a skeleton at the highest hierarchy that is expected to be most effective for absorbing an error at an initial stage so that the error will not be accumulated/increased between skeleton links can be selected as an error absorbing skeleton.
Next, it is preferable that the skeleton data includes a priority at which a skeleton is selected as a target for the error absorbing skeleton, and the error absorbing skeleton specifying part selects the error absorbing skeleton from the skeleton group having a linked relationship in accordance with the priority.
Because of the above-mentioned configuration, in selecting an error absorbing skeleton, a priority at which a skeleton is selected as an error absorbing skeleton can be previously set, which allows a user to conduct minute setting.
Next, it is preferable that the priority shows a degree of an eye-catching property as an object portion of a skeleton.
Because of the above-mentioned configuration, in selecting an error absorbing skeleton, a skeleton with a high degree of an eye-catching property whose movement for absorbing an error is considered to be conspicuous is avoided, and a skeleton with a low degree of an eye-catching property can be preferentially selected as an error absorbing skeleton.
Next, it is preferable that the error absorbing skeleton specifying part includes a skeleton masking part for specifying a skeleton that is not to be selected as the error absorbing skeleton, and the skeleton specified by the skeleton masking part is not selected as the error absorbing skeleton.
Because of the above-mentioned configuration, a particular skeleton can be prevented from being selected as an error absorbing skeleton, which allows a user to conduct minute setting.
Next, it is preferable that the skeleton data contains allowable angle data for absorbing a skeleton error, the error absorption calculating part includes an error absorption ratio calculating part for calculating an error absorption capacity from a product of an allowable angle and a length of each skeleton and calculating an error absorption ratio from the error absorption capacity of each skeleton, with respect to a total error absorption capacity of all the skeletons having a linked relationship, and an error absorption amount assigning part for assigning an absorption amount of an error with respect to the fixed position in a subsequent frame to each skeleton in accordance with the error absorption ratio, and executes inverse matrix calculation for absorbing the assigned error amount on a skeleton basis.
Because of the above-mentioned configuration, a plurality of skeletons can absorb an error in a distributed manner, and an error can be appropriately absorbed by a linked skeleton group in a distributed manner, with an error amount absorbed in a distributed manner being in accordance with the size of an allowable angle set in each skeleton.
Next, it is preferable that the error absorption ratio calculating part is capable of adjusting weighting with respect to an error absorption ratio on a skeleton basis.
Because of the above-mentioned configuration, weighting by a user can be conducted in addition to automatic assignment of an error amount based on an error absorption capacity, which enables more minute setting to be conducted.
Next, it is preferable that the fixed skeleton portion specifying part is capable of specifying a plurality of fixed skeleton portions among the skeleton group having a linked relationship, and the error absorbing skeleton specifying part selects a plurality of error absorbing skeletons.
Because of the above-mentioned configuration, a plurality of portions can be specified as fixed skeleton portions, and their errors can be absorbed by a plurality of skeletons in a distributed manner.
Next, it is preferable that, in an editing operation for absorbing an error based on skeleton calculation, matrix calculation of the fixed position calculation is executed based on calculation precision in a calculating part of a platform used in skeleton data creating/editing, thereby specifying a fixed position, and error absorption calculation by the error absorption calculating part is executed based on calculation precision in a calculating part of a platform of an apparatus for rendering a three-dimensional object, thereby absorbing a calculation rounded-off error based on calculation precision of the platform.
Because of the above-mentioned configuration, an inter-platform error can be absorbed, during development and production of animation, processing with high precision can be conducted using a platform with satisfactory calculation precision, and a fixed skeleton portion can be rendered at a correct fixed position even during use in an environment of a different platform such as game equipment of a user.
Next, the computer-readable recording medium storing processing operations for absorbing an error based on skeleton calculation in editing of skeleton data and polygon data describing a three-dimensional character of the present invention stores a program including: an input processing operation of inputting skeleton data; a fixed skeleton portion specifying processing operation of specifying a skeleton portion whose display position is desired to be fixed; an error absorbing skeleton specifying processing operation of determining an error absorbing skeleton that absorbs an error based on skeleton calculation among a skeleton group having a linked relationship up to the fixed skeleton portion; a skeleton matrix calculating processing operation of conducting matrix calculation in accordance with a linked relationship of the skeleton; a fixed position storing processing operation of storing a fixed position that is to be a matrix calculation result of the fixed skeleton portion; and an error absorption calculating processing step of adjusting a skeleton matrix of the error absorbing skeleton in such a manner that, in skeleton matrix calculation for calculating a position of the fixed skeleton portion in a frame to be subjected to error absorption, a matrix calculation result matches the fixed position.
Next, it is preferable that the skeleton data contains allowable angle data for absorbing a skeleton error, the error absorption calculating processing operation includes: an error absorption ratio calculating processing operation of calculating an error absorption capacity from a product of an allowable angle and a length of each skeleton and calculating an error absorption ratio from the error absorption capacity of each skeleton, with respect to a total error absorption capacity of all the skeletons having a linked relationship; an error absorption amount assigning processing operation of assigning an absorption amount of an error with respect to the fixed position in a subsequent frame to each skeleton in accordance with the error absorption ratio; and a processing operation of executing inverse matrix calculation for absorbing the assigned error amount on a skeleton basis.
It is preferable that, in an editing operation for absorbing an error based on skeleton calculation, the skeleton matrix calculating processing operation includes a processing operation of executing matrix calculation of the fixed position calculation based on calculation precision in a calculating part of a platform used in skeleton data creating/editing, thereby specifying a fixed position, and the error absorption calculating processing operation includes a processing operation of executing error absorption calculation based on calculation precision in a calculating part of a platform of an apparatus for rendering a three-dimensional object, thereby absorbing a calculation rounded-off error based on calculation precision of the platform.
Because of the above-mentioned configuration, by loading the processing program onto a computer, an error based on skeleton calculation can be absorbed by using a personal computer or the like, and a three-dimensional object can be rendered with smooth and natural movement